// import Echo from 'laravel-echo'
import Echo from './echo'
import io from 'weapp.socket.io'
import lstore from '@/plugins/lstore/lstore'
import config from '@/config'
export default function() {
	let headers = {}
	if (lstore.hasData(config.ACCESS_TOKEN)) {
		headers = {
			'Authorization':lstore.getData(config.ACCESS_TOKEN)
		}
	}



	let echo = new Echo({
		auth: {
			headers: {
				'Authorization':lstore.getData(config.ACCESS_TOKEN)
			}
		},
		broadcaster: 'weapp.socket.io',
		host: 'red.huo15.com:6001',
		client: io,
		devMode:true,
	})

	return echo
}
